<?php

namespace App\Models\School;

use App\Models\User\User;
use Illuminate\Database\Eloquent\Model;

class Exam extends Model
{
    protected $table = 'jxt_school_class_exams';

    protected $primaryKey = 'exam_id';


    const CREATED_AT = 'create_at';
    const UPDATED_AT = null;

    public function user()
    {
        return $this->hasOne( User::Class,'id','create_by')->select(['id','username','telephone']);
    }

    public function classes()
    {
        return $this->hasOne(Classes::Class, 'class_id', 'class_id')->select(['class_id','name']);

    }

}
